package cloudgamemysql

import (
	"gorm.io/gorm"
	"time"
)

/*
  @author liubogeng
  @date   2024/8/5 11:33
*/

// CGGame 游戏表
type CGGame struct {
	ID                              int64          `json:"id" gorm:"column:id;type:bigint;primaryKey;autoIncrement;comment:ID"`
	GameName                        string         `json:"game_name" gorm:"column:game_name;type:varchar(256);not null;default:'';comment:游戏名字"`
	AppID                           string         `json:"app_id" gorm:"column:app_id;type:varchar(500);not null;default:'';comment:某个游戏在该平台的唯一存在标识"`
	AppSecret                       string         `json:"app_secret" gorm:"column:app_secret;type:varchar(500);not null;default:'';comment:该游戏的密钥"`
	RedirectUri                     string         `json:"redirect_uri" gorm:"column:redirect_uri;type:varchar(500);not null;default:'';comment:该游戏的重定向URI地址"`
	Firm                            string         `json:"firm" gorm:"column:firm;type:varchar(64);not null;default:'';comment:游戏所属厂商"`
	Type                            int            `json:"type" gorm:"column:type;type:tinyint;default:0;not null;comment:游戏类型，映射规则再议（比如1 RPG）；默认为0 未知"`
	Summary                         string         `json:"summary" gorm:"column:summary;type:varchar(500);not null;default:'';comment:游戏简介"`
	RechargeRatio                   int            `json:"recharge_ratio" gorm:"column:recharge_ratio;type:tinyint;default:0;not null;comment:充值比例（单位元）"`
	Status                          int            `json:"status" gorm:"column:status;type:tinyint;default:0;not null;comment:0为正常 1为封禁"`
	LimitUserRechargeFreeTimeAmount string         `json:"limit_user_recharge_free_time_amount" gorm:"column:limit_user_recharge_free_time_amount;type:varchar(500);not null;default:'';comment:配置用户充值多少金额能够获得赠送的充值免费时长"`
	LimitUserGetRechargeFreeTime    string         `json:"limit_user_get_recharge_free_time" gorm:"column:limit_user_get_recharge_free_time;type:varchar(500);not null;default:'';comment:配置赠送用户多少充值免费时长"`
	CreatedAt                       time.Time      `json:"created_at" gorm:"column:created_at;type:datetime;comment:该条记录创建时间"`
	UpdatedAt                       time.Time      `json:"updated_at" gorm:"column:updated_at;type:datetime;comment:该条记录修改时间"`
	DeletedAt                       gorm.DeletedAt `json:"-" gorm:"index;type:datetime;comment:该条记录删除时间"`
}

func (CGGame) TableName() string {
	return "cg_game"
}
